const { Sequelize, DataTypes } = require('sequelize');
const { sequelize }  = require("../config/database");

const App = sequelize.define('App', {
    // 在这里定义模型属性
    aid: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
    app_id: {
      type: DataTypes.INTEGER
    },
    app_name: DataTypes.STRING(50),
    desc: DataTypes.STRING(200),
    status: DataTypes.TINYINT,
    setting_data: DataTypes.STRING,
    format_setting: DataTypes.STRING,
    add_time: DataTypes.DATE,
    update_time: DataTypes.DATE
  }, {
    // 这是其他模型参数
    freezeTableName: true,
    createdAt: 'add_time',
    updatedAt: 'update_time'
  });

  module.exports = App;